home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18206 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: got.mindspring.com!user
  2. From: got@mindspring.com (Gordon Tillman)
  3. Newsgroups: comp.lang.c,comp.lang.c++
  4. Subject: Re: [Q] Comments on "Algorithm in C" or "Algorithm in C++"
  5. Date: Fri, 19 Apr 1996 07:50:05 -0400
  6. Organization: MindSpring Enterprises
  7. Message-ID: <got-1904960750050001@got.mindspring.com>
  8. References: <4kgj3f$nug@sun.rhbnc.ac.uk> <31767bff.68611528@nntp.ix.netcom.com>
  9. NNTP-Posting-Host: got.mindspring.com
  10.  
  11. Hi Jim,
  12.  
  13. You were asking about these:
  14.  
  15. >     Yesterday I went to a bookshop and saw two books written
  16. > by Robert Sedgewick. One is
  17. >     Algorithms in C
  18. > and aother
  19. >     Algorithms in C++
  20. >  I briefly compared the two books and found they are identical. Only
  21. > differences are the covers and several words in the first chapter.
  22. > The same contents for the two books made me wonder if they are really
  23. > worth to buy. Surely "Algorithms in C++" can not be called "SOMETHING in C++"
  24. > if it does not uses the C++ feature. Before I spend money on it,
  25. > I really want to hear any comments on the books from you. Or could
  26. > you recommendate me another algorithm books on C/C++.
  27.  
  28. I have and use the _Algorithms_in_C++_ book.  I find the descriptions and
  29. examples informative.  However, I do not think the code examples are very
  30. well written.  In every case where I have used the information in the
  31. book, I have done the following:
  32.  
  33. 1.  Read through the section I am interested in.
  34. 2.  Work through the examples on paper very carefully, to make sure
  35.     I understand what Sedgewick is talking about.
  36. 3.  Write MY OWN code to implement the algorithm.
  37.  
  38. The most recent stuff that I used from that book was the section on
  39. red-black trees.  I had two goals with that information:
  40.  
  41. 1.  I wanted to implement the code as a C++ template.
  42. 2.  I thought the way the author implemented the algorithm he used
  43.     too many comparisons.  For some objects these compares could
  44.     be quite expensive.  The author hinted that the algorithm could
  45.     be implemented using fewer comparisons.  Sure enough!
  46.  
  47. Anyway, I was able to accomplish both goals, but it took about a day and a half.
  48.  
  49. I am going to take a look at the book that Michael Rubenstein recommended.
  50.  
  51. --gordon
  52.